package com.csun.dsms.mapper;

import com.csun.dsms.model.domain.DsmsRecord;
import com.csun.dsms.model.dto.record.RecordIdsAndEvaluation;
import com.csun.dsms.model.dto.record.RecordPercentDto;
import com.csun.dsms.model.dto.record.RecordQueryDto;
import com.csun.dsms.model.vo.ServiceRecordVo;
import com.csun.dsms.model.vo.project.ProjectVo;
import com.csun.dsms.model.vo.record.ProjectPercentVo;
import com.csun.dsms.model.vo.record.RecordPercentVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface DsmsRecordMapper extends Mapper<DsmsRecord> {
    /*
     *特困人员服务进度查询
     * */
    List<ServiceRecordVo> serviceRecordQuery(ServiceRecordVo serviceRecordVo);
    /*
     * 查询特困人员该月份的服务项目
     * */
    List<ProjectVo> queryServiceProject(ServiceRecordVo serviceRecordVo);
    /*
     * 网格月服务进度查询
     * */
    List<ServiceRecordVo> serviceRecordQueryByArea(ServiceRecordVo serviceRecordVo);
    /*
     * 网格日服务进度查询
     * */
    List<ServiceRecordVo> serviceRecordQueryByDay(ServiceRecordVo serviceRecordVo);
    /*
     * 查询服务项目是否分配
     * */
    List<ServiceRecordVo> serviceProjectQuery(ServiceRecordVo serviceRecordVo);

    /**
     * 查询服务记录列表 - 分页.
     *
     * @param recordQueryDto    the record query dto
     *
     * @return  the dsms record list.
     */
    List<DsmsRecord> queryListWithPage(RecordQueryDto recordQueryDto);

    /**
     * 查询服务进度
     *
     * @param recordPercentDto  the record percent dto
     *
     * @return  the record percent vo list.
     */
    List<RecordPercentVo> queryRecordPercent(RecordPercentDto recordPercentDto);

    /**
     * 查询项目进度
     *
     * @param poorId    the poor id
     * @param date  the date
     *
     * @return  the project percent vo list.
     */
    List<ProjectPercentVo> queryProjectPercent(@Param("poorId") Long poorId, @Param("date") String date);

    /*
     * 查询服务项目占比
     * */
    List<ServiceRecordVo> serviceQueryByProject();

    /**
     * 更新服务记录特困人员头像照片
     *
     * @param poorId    the poor id
     * @param headPic   the poor head pic
     *
     * @return  the int.
     */
    Integer updatePoorHeadPic(@Param("poorId") Long poorId, @Param("headPic") String headPic);

    /**
     * 更新服务记录为逾期状态
     *
     * @return
     */
    Integer dealTimeOut();
    //查询临时任务
    List<DsmsRecord> queryListByType(RecordQueryDto recordQueryDto);
    //服务评价
    Integer approvalRecordBycompany(RecordIdsAndEvaluation recordIdsAndEvaluation);
    //判断评价的记录是否已完成
    List<DsmsRecord> selectByRecordIds(@Param("ids") List<Long> ids);
    //查询当月服务项目
    List<ProjectVo> serviceRecordInfoByArea(ServiceRecordVo serviceRecordVo);
    //日服务进度详情查询
    List<ServiceRecordVo> serviceRecordInfoByDay(ServiceRecordVo serviceRecordVo);

    Integer queryServices(RecordQueryDto recordQueryDto);
}